home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Development Platforms / Apple II / Essentials / Technical.Notes / GSOS / TN.GSOS.010 < prev    next >
Encoding:
Text File  |  1992-07-15  |  2.6 KB  |  56 lines  |  [TEXT/GEOL]

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5. GS/OS
  6. #10: How Applications Find Their Files
  7.  
  8. Revised by: Matt Deatherage                                          May 1992
  9. Written by: Dave Lyons                                           January 1990
  10.  
  11. This Technical Note explains how applications should find configuration and
  12. other application-related files.
  13.  
  14. CHANGES SINCE SEPTEMBER 1990:  Lists new ways to access the @ prefix under
  15. System Software 6.0 and later.
  16. _____________________________________________________________________________
  17.  
  18.  
  19. When an application is launched, GS/OS sets prefix 9 to the application's
  20. parent directory.  It also sets prefix 1 to the same directory if the length
  21. of the pathname is within a 64-character limit.  It does not set prefix 0 to
  22. any special value.
  23.  
  24. If your application uses a partial pathname and depends upon prefix 0 to find
  25. files at the same directory level, it may be working by accident (prefix 0 is
  26. accidently set to the right directory), and sooner or later it won't work.
  27.  
  28. If your application needs to load a file named TitleScreen, the best way is to
  29. use the pathname 9:TitleScreen.  If you just use TitleScreen, you are using
  30. prefix 0, and you may or may not be looking in the right directory.
  31.  
  32. Files storing user-specific data should be stored in the at sign (@)
  33. prefix--this is just like prefix 9, except that it is set to the user's user
  34. folder on an AppleShare server if the application was launched from a server.
  35. Use @:MySettings rather than 9:MySettings or MySettings.  (If you want to
  36. retrieve the value of the @ prefix, you can call ExpandPath on the pathname
  37. "@:".)  Note that the @ prefix was introduced in System Software 5.0.
  38.  
  39. The @ prefix is useful only for applications, not for Desk Accessories, CDevs,
  40. initialization files, or anything else; this type of code can get the path of
  41. the user's folder by using the AppleShare FST's FST-Specific call GetUserPath.
  42.  
  43. Starting with System Software 6.0, you can also retrieve the value of the @
  44. prefix by passing $FFFF (-1) to GetPrefix.  You may also set the value of the
  45. @ prefix by passing $FFFF to SetPrefix, but only applications or system-wide
  46. utilities should ever change the @ prefix.  Specifically, any DAs, CDevs,
  47. initialization files or others should not mess with the @ prefix to make their
  48. own file handling simpler.
  49.  
  50.  
  51. Further Reference
  52. _____________________________________________________________________________
  53.  
  54.    o   GS/OS Reference
  55.    o   AppleTalk Technical Note #8, Using the @ Prefix
  56.